<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>节目详情</title>
    <%--<link type="text/css" rel="stylesheet" href="css/main.css" />--%>
    <link rel="stylesheet" type="text/css" href="<c:url value='/static/osyear/css/main.css'/>">
    <script language="JavaScript" src="<c:url value='/resource/js/osyear/uploadPreview.js'/>" type="text/javascript" charset="utf-8"></script>
    <script language="JavaScript" src="<c:url value='/resource/js/osyear/uploadPicture.js'/>"></script>
    <script language="JavaScript" src="<c:url value='/resource/js/osyear/jquery-1.11.0.js'/>"></script>
    <script language="JavaScript" src="<c:url value='/resource/js/jquery.form.min.js'/>"></script>
    <script language="JavaScript" src="<c:url value='/resource/js/osyear/FormValid.js'/>"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            <c:forEach var="show" items="${pager.list}" varStatus="vs">
                new uploadPreview({
                UpBtn: "showfile_${show.id}", DivShow: "showImageDiv_${show.id}", ImgShow: "showImage_${show.id}", callback: function () {
                  //  flag1 = 1;
                }
            });
            </c:forEach>
        });

        $("#pagerForm").ajaxForm(function(data){
//            parent.location.reload();
            alert('提交完成');
        });
        function subForm(id){
            $("#pagerForm_"+id).submit();
        }

        </script>

</head>
<body>
<c:forEach var="show" items="${pager.list}" varStatus="vs">
<form id="pagerForm_${show.id}"  target="submitFrame"
      action="<c:url value='/show/editP'/>" method="post" enctype="multipart/form-data" >
    <input type="hidden" name="id" value="${show.id}"/>
    <input type="hidden" name="name" value="${show.name}"/>
    <input type="hidden" name="deptId" value="${show.deptId}"/>
    <input type="hidden" name="actor" value="${show.actor}"/>
    <input type="hidden" name="ordernum" value="${show.ordernum}"/>
    <div class="jmxq">
        <div class="main_top">
            <div class="icon"><img src="<c:url value='/static/osyear/images/icon_photo.png'/>"></div>
            <input class="icon"id="showfile_${show.id}" type="file" name="picFile" accept="image/*" capture="camera"
                   style="position:absolute;top:10;right:10;width:0;height: 0"/>
            <div  id="uploadimage">
                <div id="showImageDiv_${show.id}" style="z-index: 9999">
                    <c:if test="${not empty show.pic}">
                        <img id="showImage_${show.id}" onclick="" src="data:image/png;base64,${show.pic}" height="200px"/>
                    </c:if>
                    <c:if test="${ empty show.pic}">
                        <img id="showImage_${show.id}" src="<c:url value='/static/osyear/images/pic_a.png'/>"/>
                    </c:if>
                </div>
            </div>
        </div>
        <div class="main_text">${show.name}</div>
        <div class="main_content">
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="mytable">
                <tr>
                    <td class="td1" style="width:60px; text-indent: 15px;">部门：</td>
                    <td class="td2">${show.deptName}</td>
                </tr>
                <tr>
                    <td class="td1" style="width:60px; text-indent: 15px;">演员：</td>
                    <td class="td2">${show.actor}</td>
                </tr>

            </table>
        </div>
        <div class="jmxq_btn">
            <a href="javascript:subForm(${show.id})">保存</a>
        </div>
    </div>

    </form>
</c:forEach>
<iframe  id="submitFrame" style="display: none;width:0; height:0" name="submitFrame"  src="about:blank"></iframe>
</body>
</html>
